<style>
    .layui-form-label {
        width: 120px;
    }

    .layui-input, .layui-textarea {
        width: 50%;
    }
</style>
<body>
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-body">
            <form id="saveForm" lay-filter="saveForm" class="layui-form model-form">
                <div class="layui-form-item">
                    <label class="layui-form-label">网站公告</label>
                    <div class="layui-input-block">
                        <textarea name="notice" placeholder="网站首页公告" class="layui-textarea">{{$info.notice}}</textarea>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">客服地址</label>
                    <div class="layui-input-block">
                        <input name="service_url" placeholder="客服跳转地址" value="{{$info.service_url}}" class="layui-input" autocomplete="off"/>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">充值金额范围</label>
                        <div class="layui-input-inline" style="width: 100px;">
                            <input style="width: 100%" type="text" name="recharge_min_money"
                                   placeholder="充值最小金额" value="{{$info.recharge_min_money}}" class="layui-input" autocomplete="off"/>
                        </div>
                        <div class="layui-form-mid">-</div>
                        <div class="layui-input-inline" style="width: 100px;">
                            <input style="width: 100%" type="text" name="recharge_max_money"
                                   placeholder="充值最大金额" value="{{$info.recharge_max_money}}" class="layui-input" autocomplete="off"/>
                        </div>
                    </div>
                </div>

                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">提现金额范围</label>
                        <div class="layui-input-inline" style="width: 100px;">
                            <input style="width: 100%" type="text" name="withdraw_min_money"
                                   placeholder="提现最小金额" value="{{$info.withdraw_min_money}}" class="layui-input" autocomplete="off"/>
                        </div>
                        <div class="layui-form-mid">-</div>
                        <div class="layui-input-inline" style="width: 100px;">
                            <input style="width: 100%" type="text" name="withdraw_max_money"
                                   placeholder="提现最大金额" value="{{$info.withdraw_max_money}}" class="layui-input" autocomplete="off"/>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">提现手续费(%)</label>
                    <div class="layui-input-block">
                        <input type="text" value="{{$info.withdraw_fee}}" name="withdraw_fee" placeholder="支持2位小数"
                               class="layui-input inline-block" autocomplete="off" style="width: 160px;"/>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">每日最多提现次数</label>
                    <div class="layui-input-block">
                        <input type="text" value="{{$info.withdraw_num}}" name="withdraw_num" placeholder="请输入每日提现次数"
                               class="layui-input inline-block" autocomplete="off" style="width: 160px;"/>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">提现时间限制</label>
                    <div class="layui-input-block">
                        <input type="text" value="{{$info.withdraw_time}}" name="withdraw_time" placeholder="请输入提现时间"
                               class="layui-input inline-block" autocomplete="off" style="width: 160px;"/>
                        <span style="color: #FF5722">如果早上9点到晚上10点，请输入9,22</span>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">平台手续费(%)</label>
                    <div class="layui-input-block">
                        <input type="text" value="{{$info.platform_fee}}" name="platform_fee" placeholder="支持2位小数"
                               class="layui-input inline-block" autocomplete="off" style="width: 160px;"/>
                        <span style="color: #FF5722">每笔交易平台收取的手续费</span>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">投资金额</label>
                    <div class="layui-input-block">
                        <input type="text" value="{{$info.investment}}" name="investment" placeholder="请输入投资金额"
                               class="layui-input inline-block" autocomplete="off"/>
                        <span style="color: #FF5722">以"|"符号隔开</span>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">单笔最低下单金额</label>
                    <div class="layui-input-block">
                        <input type="text" value="{{$info.order_min_money}}" name="order_min_money" placeholder="请输入单笔最低下单金额"
                               class="layui-input inline-block" autocomplete="off" style="width: 160px;"/>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">强制盈利用户</label>
                    <div class="layui-input-block">
                        <input type="text" value="{{$info.ying_uid}}" name="ying_uid" placeholder="请输入用户ID"
                               class="layui-input inline-block" autocomplete="off"/>
                        <span style="color: #FF5722">以","符号隔开</span>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">强制亏损用户</label>
                    <div class="layui-input-block">
                        <input type="text" value="{{$info.kui_uid}}" name="kui_uid" placeholder="请输入用户ID"
                               class="layui-input inline-block" autocomplete="off"/>
                        <span style="color: #FF5722">以","符号隔开</span>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-filter="saveSubmit" lay-submit>保存</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>

<!-- js部分 -->
<script type="text/javascript" src="__TPL_RESOURCE_BACKEND__/libs/layui/layui.js"></script>
<script type="text/javascript" src="__TPL_RESOURCE_BACKEND__/js/common.js"></script>

<script>
    layui.use(['layer', 'form'], function () {
        var $ = layui.jquery;
        var layer = layui.layer;
        var form = layui.form;

        form.on('submit(saveSubmit)', function (data) {
            var loading = layer.load(3);

            $.ajax({
                url: "{{:url('Websiteconfig/edit')}}",
                type: 'post',
                data: data.field,
                success: function (res) {
                    if (res.code != 0) {
                        layer.msg(res.msg, {icon: 5, time: 1000});
                    } else {
                        layer.msg(res.msg, {
                            icon: 1,
                            time: 1000
                        }, function(){
                            history.go(0);
                        });
                    }
                    layer.close(loading);
                }, error: function (err) {
                    layer.msg('网络错误请稍后重试', {icon: 5, time: 1000});
                    layer.close(loading);
                }
            });
            return false;
        });
    });
</script>
</body>
</html>
